import { IPSJsonSchema } from './ipsjson-schema';
import { PSSysDynaModelImpl } from './pssys-dyna-model-impl';

export class PSJsonSchemaImpl extends PSSysDynaModelImpl implements IPSJsonSchema {
  get description(): string {
    return this.M.description;
  }

  get refSchemaId(): string {
    return this.M.refSchemaId;
  }

  get schemaId(): string {
    return this.M.schemaId;
  }

  get type(): 'null' | 'boolean' | 'object' | 'array' | 'number' | 'string' | 'integer' {
    return this.M.type;
  }

  get enableAdditionalProperties(): boolean {
    return this.M.enableAdditionalProperties;
  }

  get refMode(): boolean {
    return this.M.refMode;
  }

  get cls(): string {
    return 'PSJsonSchemaImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dynamodel.IPSJsonNode' || cls == 'dynamodel.IPSJsonNodeOwner' || cls == 'dynamodel.IPSJsonNodeSchema' || cls == 'dynamodel.IPSJsonObjectSchema' || cls == 'dynamodel.IPSJsonSchema')
      return true;
    return super.instanceof(cls);
  }
}
